package com.cai310.lottery.web.controller.admin.info;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;

import com.cai310.lottery.Constant;
import com.cai310.lottery.common.EventLogType;
import com.cai310.lottery.common.InfoSubType;
import com.cai310.lottery.common.InfoType;
import com.cai310.lottery.common.Lottery;
import com.cai310.lottery.common.SalesMode;
import com.cai310.lottery.entity.info.AdImages;
import com.cai310.lottery.entity.info.NewsInfoData;
import com.cai310.lottery.entity.lottery.Period;
import com.cai310.lottery.entity.lottery.PeriodData;
import com.cai310.lottery.entity.lottery.PeriodSales;
import com.cai310.lottery.entity.lottery.PeriodSalesId;
import com.cai310.lottery.entity.lottery.SaleAnalyse;
import com.cai310.lottery.entity.lottery.Scheme;
import com.cai310.lottery.entity.lottery.Subscription;
import com.cai310.lottery.entity.lottery.dczc.DczcMatch;
import com.cai310.lottery.entity.lottery.dczc.DczcScheme;
import com.cai310.lottery.entity.lottery.dlt.DltPeriodData;
import com.cai310.lottery.entity.lottery.dlt.DltScheme;
import com.cai310.lottery.entity.lottery.pl.PlPeriodData;
import com.cai310.lottery.entity.lottery.seven.SevenPeriodData;
import com.cai310.lottery.entity.lottery.ssq.SsqPeriodData;
import com.cai310.lottery.entity.lottery.ssq.SsqScheme;
import com.cai310.lottery.entity.lottery.welfare3d.Welfare3dPeriodData;
import com.cai310.lottery.entity.lottery.welfare3d.Welfare3dScheme;
import com.cai310.lottery.entity.lottery.zc.LczcPeriodData;
import com.cai310.lottery.entity.lottery.zc.LczcScheme;
import com.cai310.lottery.entity.lottery.zc.SczcPeriodData;
import com.cai310.lottery.entity.lottery.zc.SczcScheme;
import com.cai310.lottery.entity.lottery.zc.SfzcPeriodData;
import com.cai310.lottery.entity.lottery.zc.SfzcScheme;
import com.cai310.lottery.entity.lottery.zc.ZcMatch;
import com.cai310.lottery.entity.security.AdminUser;
import com.cai310.lottery.exception.DataException;
import com.cai310.lottery.service.QueryService;
import com.cai310.lottery.service.ServiceException;
import com.cai310.lottery.service.info.IndexInfoDataEntityManager;
import com.cai310.lottery.service.info.NewsInfoDataEntityManager;
import com.cai310.lottery.service.lottery.EventLogManager;
import com.cai310.lottery.service.lottery.PeriodEntityManager;
import com.cai310.lottery.service.lottery.SaleAnalyseEntityManager;
import com.cai310.lottery.service.lottery.SchemeEntityManager;
import com.cai310.lottery.service.lottery.dczc.impl.DczcSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.dlt.impl.DltPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.dlt.impl.DltSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.impl.PeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.pl.impl.PlPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.pl.impl.PlSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.seven.impl.SevenPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.ssq.impl.SsqPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.ssq.impl.SsqSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.welfare3d.impl.Welfare3dPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.welfare3d.impl.Welfare3dSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.LczcPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.LczcSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.SczcPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.SczcSchemeEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.SfzcPeriodDataEntityManagerImpl;
import com.cai310.lottery.service.lottery.zc.impl.SfzcSchemeEntityManagerImpl;
import com.cai310.lottery.service.user.UserEntityManager;
import com.cai310.lottery.support.NumberSaleBean;
import com.cai310.lottery.support.pl.PlPlayType;
import com.cai310.lottery.support.zc.PlayType;
import com.cai310.lottery.web.controller.admin.AdminBaseController;
import com.cai310.orm.Pagination;
import com.cai310.utils.DateUtil;
import com.cai310.utils.FileUtils;
import com.cai310.utils.JsonUtil;
import com.cai310.utils.RandomUtils;
import com.cai310.utils.Struts2Utils;
import com.cai310.utils.TemplateGenerator;
import com.cai310.utils.WriteHTMLUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

@Namespace("/admin/info")
@Action("index")
@Results({ @Result(name = "match-info-edit", location = "/WEB-INF/content/admin/info/match-info-odds.ftl"),
		@Result(name = "index-per", location = "/WEB-INF/content/admin/info/index-per.ftl"),
		@Result(name = "upload-pic", location = "/WEB-INF/content/admin/info/upload-pic.ftl"),
		@Result(name = "static", location = "/WEB-INF/content/admin/info/static.ftl") })
public class IndexController extends AdminBaseController {
	private static final long serialVersionUID = -7128890110025210382L;
	@Autowired
	UserEntityManager userManager;
	@Autowired
	private QueryService queryService;
	@Autowired
	private PeriodEntityManager periodEntityManager;
	
	Map<String,List<Scheme>> top10Scheme=Maps.newHashMap();
	
	private Map<Lottery, SchemeEntityManager> schemeEntityManagerMap = Maps.newHashMap();
	
	@SuppressWarnings("rawtypes")
	private SchemeEntityManager getSchemeEntityManager(Lottery lotteryType) {
		return schemeEntityManagerMap.get(lotteryType);
	}
	@SuppressWarnings("rawtypes")
	@Autowired
	public void setSchemeEntityManagerList(List<SchemeEntityManager> schemeEntityManagerList) {
		for (SchemeEntityManager manager : schemeEntityManagerList) {
			schemeEntityManagerMap.put(manager.getLottery(), manager);
		}
	}

	
	@Autowired
	private SaleAnalyseEntityManager saleAnalyseEntityManager;
	/** 新闻 **/
	@Resource
	private NewsInfoDataEntityManager newsInfoDataEntityManager;

	@Resource
	private IndexInfoDataEntityManager indexInfoDataEntityManager;
 
	
	// /dlt
	@Resource
	private DltSchemeEntityManagerImpl dltSchemeEntityManagerImpl;

	// /双色球
	@Resource
	private SsqSchemeEntityManagerImpl ssqSchemeEntityManagerImpl;

	// /14,9场
	@Resource
	private SfzcSchemeEntityManagerImpl sfzcSchemeEntityManagerImpl;

	// /单场方案
	@Resource
	private DczcSchemeEntityManagerImpl dczcSchemeEntityManagerImpl;

	// /四场方案
	@Resource
	private SczcSchemeEntityManagerImpl sczcSchemeEntityManagerImpl;
	// /六场方案
	@Resource
	private LczcSchemeEntityManagerImpl lczcSchemeEntityManagerImpl;

	// /3d
	@Resource
	private Welfare3dSchemeEntityManagerImpl welfare3dSchemeEntityManagerImpl;

	// /排列
	@Resource
	private PlSchemeEntityManagerImpl plSchemeEntityManagerImpl;

	// /dlt
	@Resource
	private DltPeriodDataEntityManagerImpl dltPeriodDataEntityManagerImpl;
	
	// /ssq
	@Resource
	private SsqPeriodDataEntityManagerImpl ssqPeriodDataEntityManagerImpl;
	
	// /w3d
	@Resource
	private Welfare3dPeriodDataEntityManagerImpl welfare3dPeriodDataEntityManagerImpl;
	
	// /seven
	@Resource
	private SevenPeriodDataEntityManagerImpl sevenPeriodDataEntityManagerImpl;
	
	// /pl
	@Resource
	private PlPeriodDataEntityManagerImpl plPeriodDataEntityManagerImpl;
	
	// /sczc
	@Resource
	private SczcPeriodDataEntityManagerImpl sczcPeriodDataEntityManagerImpl;
	
	// /sfzc
	@Resource
	private SfzcPeriodDataEntityManagerImpl sfzcPeriodDataEntityManagerImpl;
	
	// /lczc
	@Resource
	private LczcPeriodDataEntityManagerImpl lczcPeriodDataEntityManagerImpl;

	@Autowired
	protected EventLogManager eventLogManager;

	/** 类型 **/
	private InfoType type;

	private Pagination pagination = new Pagination(20);

	private String periodNumber;

	private Lottery lottery;

	private List<DczcMatch> matchList;

	private String createContent;

	private Period period;

	private List<Period> periodList;

	private List<DczcMatch> dczcMatchList;

	private ZcMatch[] matchArr;

	private Date compoundEndTime;

	private Date singleEndTime;

	private List<NewsInfoData> infoList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> totoInfoList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> numInfoList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> topInfoList = new ArrayList<NewsInfoData>();
	private NewsInfoData topTotoInfo = null;
	private NewsInfoData topNumInfo = null;
	private DltPeriodData dltPoolPeriodData;
	private Period dltPoolPeriod;
	private List<NewsInfoData> forecastList = new ArrayList<NewsInfoData>();
	private List<Scheme> topSchemeList = new ArrayList<Scheme>();
	private List<Scheme> hotSchemeList = new ArrayList<Scheme>();
	private List<Scheme> wonSchemeList = new ArrayList<Scheme>();

	private Boolean scExists = Boolean.FALSE;
	private Boolean zcExists = Boolean.FALSE;
	
	private SsqPeriodData ssqPeriodData;
	private NumberSaleBean ssqSaleBean;
	private Period ssqPeriod;
	
	private DltPeriodData dltPeriodData;
	private NumberSaleBean dltSaleBean;
	private Period dltPeriod;
	
	private Welfare3dPeriodData welfare3dPeriodData;
	private NumberSaleBean welfare3dSaleBean;
	private Period welfare3dPeriod;
	
	private PlPeriodData plPeriodData;
	private Period plPeriod;
	
	private SevenPeriodData sevenPeriodData;
	private Period sevenPeriod;
	
	private List zjphList;

	private SfzcPeriodData sfzcPeriodData;
	private Period sfzcPeriod;
	private SczcPeriodData sczcPeriodData;
	private Period sczcPeriod;
	private LczcPeriodData lczcPeriodData;
	private Period lczcPeriod;
	private List<SaleAnalyse> allSaleAnalyseList = Lists.newArrayList();
	private List<SaleAnalyse> ssqSaleAnalyseList = Lists.newArrayList();
	private List<SaleAnalyse> dltSaleAnalyseList = Lists.newArrayList();
	private List<SaleAnalyse> sfzcSaleAnalyseList = Lists.newArrayList();
	private List<SaleAnalyse> dczcSaleAnalyseList = Lists.newArrayList();
	private List<NewsInfoData> redianList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> gonggaoList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> helpList = new ArrayList<NewsInfoData>(); 
	private   List<Subscription> zhongjiangList = new ArrayList<Subscription>();
	private List<NewsInfoData> jczqList = new ArrayList<NewsInfoData>();
	private List<NewsInfoData> jclqList = new ArrayList<NewsInfoData>();
	
	Map<String,Object> contents=new HashMap<String,Object>();
	private NewsInfoData firstJczqNews;
	private List<NewsInfoData> jczqNewsList = new ArrayList<NewsInfoData>();
	private NewsInfoData firstDczcNews;
	private List<NewsInfoData> dczcNewsList = new ArrayList<NewsInfoData>();
	private NewsInfoData firstSfzcNews;
	private List<NewsInfoData> sfzcNewsList = new ArrayList<NewsInfoData>();
	
	private NewsInfoData firstDltNews;
	private List<NewsInfoData> dltNewsList = new ArrayList<NewsInfoData>();
	private NewsInfoData firstSsqNews;
	private List<NewsInfoData> ssqNewsList = new ArrayList<NewsInfoData>();
	private NewsInfoData firstSevenNews;
	private List<NewsInfoData> sevenNewsList = new ArrayList<NewsInfoData>();
	/**
	 * 后台首页生成
	 * 
	 * @return
	 */
	@Action("/indexView")
	public String indexPer() {
		try {
			contents.put("base", Constant.BASEPATH);
			//ssqSaleAnalyseList = saleAnalyseEntityManager.getTop10SaleAnalyse(Lottery.SSQ, DateUtil.getMonth(new Date()));
			//dltSaleAnalyseList = saleAnalyseEntityManager.getTop10SaleAnalyse(Lottery.DLT, DateUtil.getMonth(new Date()));
			//sfzcSaleAnalyseList = saleAnalyseEntityManager.getTop10SaleAnalyse(Lottery.SFZC, DateUtil.getMonth(new Date()));
			//dczcSaleAnalyseList = saleAnalyseEntityManager.getTop10SaleAnalyse(Lottery.DCZC, DateUtil.getMonth(new Date()));
			
			List<Subscription> allSaleAnalyseListTemp = welfare3dSchemeEntityManagerImpl.getTop10SaleAnalyse();
			//List<SaleAnalyse> allSaleAnalyseListTemp = saleAnalyseEntityManager.getTop10SaleAnalyse();
			for (Subscription subscription : allSaleAnalyseListTemp) {
				SaleAnalyse saleAnalyse = new SaleAnalyse();
				saleAnalyse.setUserId(subscription.getUserId());
				saleAnalyse.setUserName(subscription.getUserName());
				saleAnalyse.setSubscriptionSuccessWonPrize(subscription.getBonus());
				if(null!=saleAnalyse.getSubscriptionSuccessWonPrize())allSaleAnalyseList.add(saleAnalyse);
			}
			contents.put("allSaleAnalyseList", allSaleAnalyseList);
			contents.put("ssqSaleAnalyseList", ssqSaleAnalyseList);
			contents.put("dltSaleAnalyseList", dltSaleAnalyseList);
			contents.put("sfzcSaleAnalyseList", sfzcSaleAnalyseList);
			contents.put("dczcSaleAnalyseList", dczcSaleAnalyseList);
			
			//新闻
			redianList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,null,InfoSubType.REDIAN,6, true);
			contents.put("redianList", redianList);
			gonggaoList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,null,InfoSubType.GONGGAO, 6, true);
			System.out.println("============================================================="+gonggaoList.size());
			
			contents.put("gonggaoList", gonggaoList);
			helpList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,null,InfoSubType.HELP, 6, true);
			contents.put("helpList", helpList);
			
			jczqList = newsInfoDataEntityManager.getNewsInfoDataBy(null,Lottery.JCZQ,null, 5, true);
			contents.put("jczqList", jczqList);
			jclqList = newsInfoDataEntityManager.getNewsInfoDataBy(null,Lottery.JCLQ,null, 5, true);
			contents.put("jclqList", jclqList);
			
			jczqNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.JCZQ,null, 5, true);
			for (NewsInfoData newsInfoData : jczqNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstJczqNews = newsInfoData;
					jczqNewsList.remove(jczqNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("jczqNewsList", jczqNewsList);
			contents.put("firstJczqNews", firstJczqNews);
			
			sfzcNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.SFZC,null, 5, true);
			for (NewsInfoData newsInfoData : sfzcNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstSfzcNews = newsInfoData;
					sfzcNewsList.remove(sfzcNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("sfzcNewsList", sfzcNewsList);
			contents.put("firstSfzcNews", firstSfzcNews);
			
			dczcNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.DCZC,null, 5, true);
			for (NewsInfoData newsInfoData : dczcNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstDczcNews = newsInfoData;
					dczcNewsList.remove(dczcNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("dczcNewsList", dczcNewsList);
			contents.put("firstDczcNews", firstDczcNews);
			
			dltNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.DLT,null, 5, true);
			for (NewsInfoData newsInfoData : dltNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstDltNews = newsInfoData;
					dltNewsList.remove(dltNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("dltNewsList", dltNewsList);
			contents.put("firstDltNews", firstDltNews);
			
			ssqNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.SSQ,null, 5, true);
			for (NewsInfoData newsInfoData : ssqNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstSsqNews = newsInfoData;
					ssqNewsList.remove(ssqNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("ssqNewsList", ssqNewsList);
			contents.put("firstSsqNews", firstSsqNews);
			
			sevenNewsList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,Lottery.SEVEN,null, 5, true);
			for (NewsInfoData newsInfoData : sevenNewsList) {
				if(null!=newsInfoData.getFirstImgSrc()){
					firstSevenNews = newsInfoData;
					sevenNewsList.remove(sevenNewsList.indexOf(newsInfoData));
					break;
				}
			}
			contents.put("sevenNewsList", sevenNewsList);
			contents.put("firstSevenNews", firstSevenNews);
			// 预测最新
			forecastList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.FORECAST, null, 5, true);
			// 资讯最新
			infoList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO, null, 5, true);
			// 足球资讯最新
			List<NewsInfoData> totoInfoListTemp = newsInfoDataEntityManager.getNewsInfoDataByArr(InfoType.INFO,
					new Lottery[] { Lottery.DCZC, Lottery.SFZC, Lottery.SCZC, Lottery.LCZC }, 6, true);
			if (null != totoInfoListTemp && !totoInfoListTemp.isEmpty()) {
				for (NewsInfoData newsInfoData : totoInfoListTemp) {
					if (null == topTotoInfo) {
						topTotoInfo = newsInfoData;
					} else {
						totoInfoList.add(newsInfoData);
					}
				}
			}
			// 数字彩资讯最新
			List<NewsInfoData> numInfoListTemp = newsInfoDataEntityManager.getNewsInfoDataByArr(InfoType.INFO,
					new Lottery[] { Lottery.SSQ, Lottery.DLT, Lottery.SEVEN, Lottery.WELFARE36To7, Lottery.PL,
							Lottery.WELFARE3D }, 6, true);
			if (null != numInfoListTemp && !numInfoListTemp.isEmpty()) {
				for (NewsInfoData newsInfoData : numInfoListTemp) {
					if (null == topNumInfo) {
						topNumInfo = newsInfoData;
					} else {
						numInfoList.add(newsInfoData);
					}
				}
			}
			topInfoList = newsInfoDataEntityManager.getNewsInfoDataBy(null, null, 10, true);
			
			ssqPeriodData = (SsqPeriodData) this.getNewPeriodData(Lottery.SSQ, SsqPeriodData.class, ssqPeriodDataEntityManagerImpl);
			ssqSaleBean = this.getNewPeriod(Lottery.SSQ);
			if(null!=ssqPeriodData){
				ssqPeriod = this.getNewResultPeriod(Lottery.SSQ, ssqPeriodData.getPeriodId());
			}
			contents.put("ssqPeriodData", ssqPeriodData);
			contents.put("ssqSaleBean", ssqSaleBean);
			contents.put("ssqPeriod", ssqPeriod);
			
			dltPeriodData = (DltPeriodData) this.getNewPeriodData(Lottery.DLT, DltPeriodData.class, dltPeriodDataEntityManagerImpl);
			dltSaleBean = this.getNewPeriod(Lottery.DLT);
			if(null!=dltPeriodData){
				dltPeriod = this.getNewResultPeriod(Lottery.DLT, dltPeriodData.getPeriodId());
			}
			contents.put("dltPeriodData", dltPeriodData);
			contents.put("dltSaleBean", dltSaleBean);
			contents.put("dltPeriod", dltPeriod);
			
			welfare3dPeriodData = (Welfare3dPeriodData) this.getNewPeriodData(Lottery.WELFARE3D, Welfare3dPeriodData.class, welfare3dPeriodDataEntityManagerImpl);
			welfare3dSaleBean = this.getNewPeriod(Lottery.WELFARE3D);
			if(null!=welfare3dPeriodData){
				welfare3dPeriod = this.getNewResultPeriod(Lottery.WELFARE3D, welfare3dPeriodData.getPeriodId());
			}
			contents.put("welfare3dPeriodData", welfare3dPeriodData);
			contents.put("welfare3dSaleBean", welfare3dSaleBean);
			contents.put("welfare3dPeriod", welfare3dPeriod);
			
			plPeriodData = (PlPeriodData) this.getNewPeriodData(Lottery.PL, PlPeriodData.class, plPeriodDataEntityManagerImpl);
			if(null!=plPeriodData){
				plPeriod = this.getNewResultPeriod(Lottery.PL, plPeriodData.getPeriodId());
			}
			contents.put("plPeriodData", plPeriodData);
			contents.put("plPeriod", plPeriod);
			
			sevenPeriodData = (SevenPeriodData) this.getNewPeriodData(Lottery.SEVEN, SevenPeriodData.class, sevenPeriodDataEntityManagerImpl);
			if(null!=sevenPeriodData){
				sevenPeriod = this.getNewResultPeriod(Lottery.SEVEN, sevenPeriodData.getPeriodId());
			}
			contents.put("sevenPeriodData", sevenPeriodData);
			contents.put("sevenPeriod", sevenPeriod);
			
			sfzcPeriodData = (SfzcPeriodData) this.getNewPeriodData(Lottery.SFZC, SfzcPeriodData.class, sfzcPeriodDataEntityManagerImpl);
			if(null!=sfzcPeriodData){
				sfzcPeriod = this.getNewResultPeriod(Lottery.SFZC, sfzcPeriodData.getPeriodId());
			}
			contents.put("sfzcPeriodData", sfzcPeriodData);
			contents.put("sfzcPeriod", sfzcPeriod);
			
			sczcPeriodData = (SczcPeriodData) this.getNewPeriodData(Lottery.SCZC, SczcPeriodData.class, sczcPeriodDataEntityManagerImpl);
			if(null!=sczcPeriodData){
				sczcPeriod = this.getNewResultPeriod(Lottery.SCZC, sczcPeriodData.getPeriodId());
			}
			contents.put("sczcPeriodData", sczcPeriodData);
			contents.put("sczcPeriod", sczcPeriod);
			
			
			
			lczcPeriodData = (LczcPeriodData) this.getNewPeriodData(Lottery.LCZC, LczcPeriodData.class, lczcPeriodDataEntityManagerImpl);
			if(null!=lczcPeriodData){
				lczcPeriod = this.getNewResultPeriod(Lottery.LCZC, lczcPeriodData.getPeriodId());
			}
			contents.put("lczcPeriodData", lczcPeriodData);
			contents.put("lczcPeriod", lczcPeriod);
			
			DetachedCriteria criteria = DetachedCriteria.forClass(AdImages.class);
			criteria.addOrder(Order.asc("pos"));
			adImagesList = queryService.findByDetachedCriteria(criteria);
			
			contents.put("adImagesList", adImagesList);
			//推介合买
			Lottery[] lotteryArr = {Lottery.JCZQ};
			 List<Period> periodList = null;
				Period period=null;
				for (Lottery lottery : lotteryArr) {
					periodList= periodEntityManager.findCurrentPeriods(lottery, true);
						 if(null!=periodList&&!periodList.isEmpty()){ 
							for (Period periodTemp : periodList) {
							if(periodTemp.isOnSale()){
								period = periodTemp;
					       }
				    }
				}
				if(null!=period){	
					top10Scheme.put(lottery.getKey(), this.getSchemeEntityManager(lottery).findTop10Scheme(period.getId()));	
				}
			}	
			contents.put("top10Scheme", top10Scheme);
			//zhongjiangList = newsInfoDataEntityManager.getNewsInfoDataBy(InfoType.INFO,null,InfoSubType.ZHONGJIANG, 5, true);
			zhongjiangList = welfare3dSchemeEntityManagerImpl.getNewestWon();
			contents.put("zhongjiangList", zhongjiangList);
			//中奖排行
			zjphList = welfare3dSchemeEntityManagerImpl.getTopWon();
			contents.put("zjphList", zjphList);
			return "index-per";
		} catch (ServiceException e) {
			logger.error(e.getMessage(), e);
			addActionMessage(e.getMessage());
		} catch (Exception e) {
			addActionMessage(e.getMessage());
			logger.error(e.getMessage(), e);
		}

		return error();
	}
    public PeriodData getNewPeriodData(Lottery lottery,Class periodDataClass,PeriodDataEntityManagerImpl periodDataEntityManagerImpl){
    	//读js文件
		String dir = "/html/js/data/" + lottery.getKey() + "/";
		String period_data = WriteHTMLUtil.readFile(dir, "period_data.js");
		PeriodData newestPeriodData = null;
		if(StringUtils.isNotBlank(period_data)){
			try{
					Map<String, Object> map = JsonUtil.getMap4Json(period_data);
					String periodData = String.valueOf(map.get("periodData"));
					newestPeriodData = (PeriodData)JsonUtil.getObject4JsonString(periodData,periodDataClass);
			}catch(Exception e){
					logger.error(lottery.getLotteryName()+"最新开奖文件解析错误");
			}
		}
		if(null==newestPeriodData){
			newestPeriodData = periodDataEntityManagerImpl.getNewestResultPeriodData();
		}
		return newestPeriodData;
    }
    public Period getNewResultPeriod(Lottery lottery,Long id){
    	//读js文件
		String dir = "/html/js/data/" + lottery.getKey() + "/";
		String period_data = WriteHTMLUtil.readFile(dir, "period_data.js");
		Period newestPeriod = null;
		if(StringUtils.isNotBlank(period_data)){
			try{
					Map<String, Object> map = JsonUtil.getMap4Json(period_data);
					String periodData = String.valueOf(map.get("period"));
					newestPeriod = (Period)JsonUtil.getObject4JsonString(periodData,Period.class);
			}catch(Exception e){
					logger.error(lottery.getLotteryName()+"最新开奖文件解析错误");
			}
		}
		if(null==newestPeriod){
			newestPeriod = periodEntityManager.getPeriod(id);
		}
		return newestPeriod;
    }
    public NumberSaleBean getNewPeriod(Lottery lottery){
    	//读js文件
		String dir = "/html/js/data/" + lottery.getKey() + "/";
		String period_data = WriteHTMLUtil.readFile(dir, "sale_period.js");
		NumberSaleBean numberSaleBean = null;
		if(StringUtils.isNotBlank(period_data)){
			try{
					Map<String, Object> map = JsonUtil.getMap4Json(period_data);
					String numberSaleBeanData = String.valueOf(map.get("numberSaleBean"));
					numberSaleBean = JsonUtil.getObject4JsonString(numberSaleBeanData,NumberSaleBean.class);
			}catch(Exception e){
					logger.error(lottery.getLotteryName()+"最新开奖文件解析错误");
			}
		}
		if(null==numberSaleBean){
			List<Period> currentPeriods = periodEntityManager.findCurrentPeriods(lottery);
			if (currentPeriods != null && !currentPeriods.isEmpty()) {
				for (Period period : currentPeriods) {
					if(period.isOnSale()&&period.isCurrent()){
						PeriodSales compoundPeriodSale = periodEntityManager.getPeriodSales(new PeriodSalesId(period.getId(), SalesMode.COMPOUND));
						if(compoundPeriodSale.isOnSale()){
							numberSaleBean = new NumberSaleBean();
							numberSaleBean.setId(period.getId());
							numberSaleBean.setLotteryType(period.getLotteryType());
							numberSaleBean.setPeriodNumber(period.getPeriodNumber());
							numberSaleBean.setSelfEndInitTime(DateUtil.dateToStr(compoundPeriodSale.getSelfEndInitTime(),"yyyy-MM-dd HH:mm:ss"));
						}
					}
				}
			}
			
		}
		return numberSaleBean;
    }
	public String staticIndex() {
		return "static";
	}

	private List<AdImages> adImagesList;
	private File pic1_file;
	private String pic1_word;
	private String pic1_link;

	private File pic2_file;
	private String pic2_word;
	private String pic2_link;

	private File pic3_file;
	private String pic3_word;
	private String pic3_link;

	private File pic4_file;
	private String pic4_word;
	private String pic4_link;
	
	private File pic5_file;
	private String pic5_word;
	private String pic5_link;
	
	
	

	private File pic6_file;
	private String pic6_word;
	private String pic6_link;

	public String uploadPic() {
		if ("GET".equals(Struts2Utils.getRequest().getMethod())) {// 转向登录页面
			DetachedCriteria criteria = DetachedCriteria.forClass(AdImages.class);
			criteria.addOrder(Order.asc("pos"));
			adImagesList = queryService.findByDetachedCriteria(criteria);
			return "upload-pic";
		} else {
			try {
				if (null != pic1_file && (StringUtils.isNotBlank(pic1_word)) && (StringUtils.isNotBlank(pic1_link))) {
					uploadPicMethod(1, pic1_file, pic1_word, pic1_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic4_file
							+ "}");
				}
				if (null != pic2_file && (StringUtils.isNotBlank(pic2_word)) && (StringUtils.isNotBlank(pic2_link))) {
					uploadPicMethod(2, pic2_file, pic2_word, pic2_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic4_file
							+ "}");
				}
				if (null != pic3_file && (StringUtils.isNotBlank(pic3_word)) && (StringUtils.isNotBlank(pic3_link))) {
					uploadPicMethod(3, pic3_file, pic3_word, pic3_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic4_file
							+ "}");
				}
				if (null != pic4_file && (StringUtils.isNotBlank(pic4_word)) && (StringUtils.isNotBlank(pic4_link))) {
					uploadPicMethod(4, pic4_file, pic4_word, pic4_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic4_file
							+ "}");
				}
				
				if (null != pic5_file && (StringUtils.isNotBlank(pic5_word)) && (StringUtils.isNotBlank(pic5_link))) {
					uploadPicMethod(5, pic5_file, pic5_word, pic5_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic5_file
							+ "}");
				}
				
				if (null != pic6_file && (StringUtils.isNotBlank(pic6_word)) && (StringUtils.isNotBlank(pic6_link))) {
					uploadPicMethod(6, pic6_file, pic6_word, pic6_link);
					// 记录操作日志
					eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "上传图片：{" + pic6_file
							+ "}");
				}
				
				
				addActionError("上传成功");
				DetachedCriteria criteria = DetachedCriteria.forClass(AdImages.class);
				criteria.addOrder(Order.asc("pos"));
				adImagesList = queryService.findByDetachedCriteria(criteria);
			} catch (DataException e) {
				addActionError(e.getMessage());
				this.logger.error(e.getMessage());
			}
			return "upload-pic";
		}

	}
	public String deletePic() {
		try {
			String id = Struts2Utils.getParameter("id");
			if(StringUtils.isNotBlank(id)){
				indexInfoDataEntityManager.deleteAdPic(Long.valueOf(id));
				eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "删除图片：{" +id 
						+ "}");
			}
			addActionError("删除成功");
			
		} catch (DataException e) {
			addActionError(e.getMessage());
			this.logger.error(e.getMessage());
		}
		return uploadPic();
	}
	public void uploadPicMethod(Integer pos, File file, String word, String link) throws DataException {
		if (null == file)
			throw new DataException("广告" + pos + "上传的文件为空");
		if (StringUtils.isBlank(word))
			throw new DataException("广告" + pos + "连接为空");
		if (StringUtils.isBlank(link))
			throw new DataException("广告" + pos + "连接为空");
		String fileName = uploadMethod(file);
		AdImages adImages = new AdImages();
		adImages.setPos(pos);
		adImages.setName(fileName);
		adImages.setLink(link);
		adImages.setWord(word);
		indexInfoDataEntityManager.uploadAdPic(adImages);
		
		createAdImagesFile();
	}

	
	
	public void createAdImagesFile() throws DataException {
		Map<String, Object> contents = new HashMap<String, Object>();
		contents.put("base", Constant.BASEPATH);
		DetachedCriteria criteria = DetachedCriteria.forClass(AdImages.class);
		criteria.addOrder(Order.asc("pos"));
		List<AdImages> adImagesList = queryService.findByDetachedCriteria(criteria);
		contents.put("adImagesList", adImagesList);
		try {
			TemplateGenerator tg = new TemplateGenerator(Constant.ROOTPATH + "/WEB-INF/content/admin/info");
			tg.create("index-adImages.ftl", contents, "index-adImages.html", Constant.ROOTPATH + "/html/info/adImages");
		} catch (Exception e) {
			e.printStackTrace();
			throw new DataException("生成静态文件失败");
		}
	}
	
	
	public String uploadMethod(File uploadFile) throws DataException {
		String context = Constant.ROOTPATH;
		String fileName = "" + System.currentTimeMillis() + RandomUtils.generateLowerString(6) + ".jpg";
		File fileTemp = new File(FileUtils.combinePath(context, FileUtils.path));
		if (!fileTemp.isDirectory()) {
			fileTemp.mkdirs();
		}
		File file = new File(FileUtils.combinePath(context, FileUtils.path + fileName));
		try {
			if (!FileUtils.isImage(uploadFile)) {
				throw new DataException("上传的文件不是图片");
			}
			FileUtils.copy(uploadFile, file);
		} catch (IOException e) {
			throw new DataException("上传图片出错");
		}
		return FileUtils.path + fileName;
	}

	public String makeIndex() {
		try {
			AdminUser adminUser = getAdminUser();
			if (null == adminUser) {
				throw new DataException("权限不足！");
			}
			this.indexPer();
			
			createIndexFile(contents, "/WEB-INF/content/admin/info/index-per.ftl", "index.html");
			
			// 记录操作日志
			eventLogManager.saveSimpleEventLog(null, getLottery(), adminUser, EventLogType.Index_Admin, "首页生成");
			addActionMessage("生成首页成功!");
		} catch (Exception e) {
			e.printStackTrace();
			addActionError("生成首页失败!");
		}
		return staticIndex();
	}
	/**
	 * 生成静态文件工具类
	 * @param contents
	 * @param sourcefile
	 * @param destinationFileName
	 * @throws DataException
	 */
	public void createIndexFile(Map<String,Object> contents,String sourcefile,String destinationFileName)throws DataException{
		try {
			TemplateGenerator tg=new TemplateGenerator(true);

			tg.create(sourcefile, contents, destinationFileName, Constant.ROOTPATH+"/");

		} catch (Exception e) {
			e.printStackTrace();
			throw new DataException("生成静态文件失败");
		}
	}
	/**
	 * 生成最新中奖静态页
	 * 
	 * @return
	 * @throws DataException
	 */
	@SuppressWarnings("unchecked")
	public void makeNewWonScheme(Map<String,Object> contents) throws DataException {
		// 非高频彩
		DetachedCriteria criteria = DetachedCriteria.forClass(com.cai310.lottery.entity.lottery.Scheme.class);
		criteria.add(Restrictions.eq("won", true));
		criteria.addOrder(Order.desc("commitTime"));
		wonSchemeList = queryService.findByDetachedCriteria(criteria, 0, 6);
		if(null!=contents){
			contents.put("wonSchemeList", wonSchemeList);
		}
	}

	/**
	 * 生成热门方案
	 * 
	 * @return
	 */
	public void makeTopScheme(Map<String,Object> contents) throws DataException {
		// 大乐透生成
		List<DltScheme> dltTopScheme = dltSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(dltTopScheme);
		// /双色球
		List<SsqScheme> ssqTopScheme = ssqSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(ssqTopScheme);
		// /四场进球
		List<SczcScheme> sczcTopScheme = sczcSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(sczcTopScheme);
		// 六场
		List<LczcScheme> lczcTopScheme = lczcSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(lczcTopScheme);
		// 单场
		List<DczcScheme> dczcTopScheme = dczcSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(dczcTopScheme);
		// 14
		List<SfzcScheme> sfzc14TopScheme = sfzcSchemeEntityManagerImpl.getTopScheme(0, 5, PlayType.SFZC14);
		topSchemeList.addAll(sfzc14TopScheme);
		// 9
		List<SfzcScheme> sfzc9TopScheme = sfzcSchemeEntityManagerImpl.getTopScheme(0, 5, PlayType.SFZC9);
		topSchemeList.addAll(sfzc9TopScheme);
		// 3d
		List<Welfare3dScheme> welfare3dTopScheme = welfare3dSchemeEntityManagerImpl.getTopScheme(0, 5);
		topSchemeList.addAll(welfare3dTopScheme);
		// pl3
		List<SfzcScheme> pl3TopScheme = plSchemeEntityManagerImpl.getTopScheme(0, 5, null);
		topSchemeList.addAll(pl3TopScheme);
		// pl5
		List<SfzcScheme> pl5TopScheme = plSchemeEntityManagerImpl.getTopScheme(0, 5, PlPlayType.P5Direct);
		topSchemeList.addAll(pl5TopScheme);
		Collections.sort(topSchemeList, new Comparator<Scheme>() {
			public int compare(Scheme o1Scheme, Scheme o2Scheme) {
				if (Integer.valueOf(o1Scheme.getOrderPriority()) == Integer.valueOf(o2Scheme.getOrderPriority())) {
					if (o1Scheme.getSchemeCost() == o2Scheme.getSchemeCost()) {
						return o1Scheme.getSchemeCost() - o2Scheme.getSchemeCost();
					} else {
						if (o1Scheme.getProgressRate() - o2Scheme.getProgressRate() > 0) {
							return 1;
						} else {
							return 0;
						}
					}
				} else {
					return Integer.valueOf(o1Scheme.getOrderPriority()) - Integer.valueOf(o2Scheme.getOrderPriority());
				}

			}
		});
		if(null!=contents){
			contents.put("topSchemeList", topSchemeList);
		}
	}

	/**
	 * 生成热门跟单
	 * 
	 * @return
	 */
	public void makeHotScheme(Map<String,Object> contents) throws DataException {
		// 大乐透生成
		List<DltScheme> dltTopScheme = dltSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(dltTopScheme);
		// /双色球
		List<SsqScheme> ssqTopScheme = ssqSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(ssqTopScheme);
		// /四场进球
		List<SczcScheme> sczcTopScheme = sczcSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(sczcTopScheme);
		// 六场
		List<LczcScheme> lczcTopScheme = lczcSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(lczcTopScheme);
		// 单场
		List<DczcScheme> dczcTopScheme = dczcSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(dczcTopScheme);
		// 14
		List<SfzcScheme> sfzc14TopScheme = sfzcSchemeEntityManagerImpl.getHotScheme(0, 5, PlayType.SFZC14);
		hotSchemeList.addAll(sfzc14TopScheme);
		// 9
		List<SfzcScheme> sfzc9TopScheme = sfzcSchemeEntityManagerImpl.getHotScheme(0, 5, PlayType.SFZC9);
		hotSchemeList.addAll(sfzc9TopScheme);
		// 3d
		List<Welfare3dScheme> welfare3dTopScheme = welfare3dSchemeEntityManagerImpl.getHotScheme(0, 5);
		hotSchemeList.addAll(welfare3dTopScheme);
		// pl3
		List<SfzcScheme> pl3TopScheme = plSchemeEntityManagerImpl.getHotScheme(0, 5, null);
		hotSchemeList.addAll(pl3TopScheme);
		// pl5
		List<SfzcScheme> pl5TopScheme = plSchemeEntityManagerImpl.getHotScheme(0, 5, PlPlayType.P5Direct);
		hotSchemeList.addAll(pl5TopScheme);
		Collections.sort(hotSchemeList, new Comparator<Scheme>() {
			public int compare(Scheme o1Scheme, Scheme o2Scheme) {
				if (o1Scheme.getSchemeCost() == o2Scheme.getSchemeCost()) {
					return o1Scheme.getSchemeCost() - o2Scheme.getSchemeCost();
				} else {
					if (o1Scheme.getProgressRate() - o2Scheme.getProgressRate() > 0) {
						return 1;
					} else {
						return 0;
					}
				}

			}
		});
		if(null!=contents){
			contents.put("hotSchemeList", hotSchemeList);
		}
	}

	public String getPeriodNumber() {
		return periodNumber;
	}

	public void setPeriodNumber(String periodNumber) {
		this.periodNumber = periodNumber;
	}

	public List<DczcMatch> getMatchList() {
		return matchList;
	}

	public void setMatchList(List<DczcMatch> matchList) {
		this.matchList = matchList;
	}

	/**
	 * @return the createContent
	 */
	public String getCreateContent() {
		return createContent;
	}

	/**
	 * @param createContent the createContent to set
	 */
	public void setCreateContent(String createContent) {
		this.createContent = createContent;
	}

	/**
	 * @return the type
	 */
	public InfoType getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(InfoType type) {
		this.type = type;
	}

	/**
	 * @return the pagination
	 */
	public Pagination getPagination() {
		return pagination;
	}

	/**
	 * @param pagination the pagination to set
	 */
	public void setPagination(Pagination pagination) {
		this.pagination = pagination;
	}

	public Period getPeriod() {
		return period;
	}

	public void setPeriod(Period period) {
		this.period = period;
	}

	public Lottery getLottery() {
		return lottery;
	}

	public void setLottery(Lottery lottery) {
		this.lottery = lottery;
	}

	public List<Period> getPeriodList() {
		return periodList;
	}

	public void setPeriodList(List<Period> periodList) {
		this.periodList = periodList;
	}

	public List<DczcMatch> getDczcMatchList() {
		return dczcMatchList;
	}

	public void setDczcMatchList(List<DczcMatch> dczcMatchList) {
		this.dczcMatchList = dczcMatchList;
	}

	public ZcMatch[] getMatchArr() {
		return matchArr;
	}

	public void setMatchArr(ZcMatch[] matchArr) {
		this.matchArr = matchArr;
	}

	public Date getCompoundEndTime() {
		return compoundEndTime;
	}

	public void setCompoundEndTime(Date compoundEndTime) {
		this.compoundEndTime = compoundEndTime;
	}

	public Date getSingleEndTime() {
		return singleEndTime;
	}

	public void setSingleEndTime(Date singleEndTime) {
		this.singleEndTime = singleEndTime;
	}

	public List<NewsInfoData> getInfoList() {
		return infoList;
	}

	public void setInfoList(List<NewsInfoData> infoList) {
		this.infoList = infoList;
	}

	public List<NewsInfoData> getTotoInfoList() {
		return totoInfoList;
	}

	public void setTotoInfoList(List<NewsInfoData> totoInfoList) {
		this.totoInfoList = totoInfoList;
	}

	public List<NewsInfoData> getNumInfoList() {
		return numInfoList;
	}

	public void setNumInfoList(List<NewsInfoData> numInfoList) {
		this.numInfoList = numInfoList;
	}

	public NewsInfoData getTopTotoInfo() {
		return topTotoInfo;
	}

	public void setTopTotoInfo(NewsInfoData topTotoInfo) {
		this.topTotoInfo = topTotoInfo;
	}

	public NewsInfoData getTopNumInfo() {
		return topNumInfo;
	}

	public void setTopNumInfo(NewsInfoData topNumInfo) {
		this.topNumInfo = topNumInfo;
	}

	public List<NewsInfoData> getForecastList() {
		return forecastList;
	}

	public void setForecastList(List<NewsInfoData> forecastList) {
		this.forecastList = forecastList;
	}

	public List<Scheme> getTopSchemeList() {
		return topSchemeList;
	}

	public void setTopSchemeList(List<Scheme> topSchemeList) {
		this.topSchemeList = topSchemeList;
	}

	public DltPeriodData getDltPoolPeriodData() {
		return dltPoolPeriodData;
	}

	public void setDltPoolPeriodData(DltPeriodData dltPoolPeriodData) {
		this.dltPoolPeriodData = dltPoolPeriodData;
	}

	public Period getDltPoolPeriod() {
		return dltPoolPeriod;
	}

	public void setDltPoolPeriod(Period dltPoolPeriod) {
		this.dltPoolPeriod = dltPoolPeriod;
	}

	public List<Scheme> getWonSchemeList() {
		return wonSchemeList;
	}

	public void setWonSchemeList(List<Scheme> wonSchemeList) {
		this.wonSchemeList = wonSchemeList;
	}

	public List<NewsInfoData> getTopInfoList() {
		return topInfoList;
	}

	public void setTopInfoList(List<NewsInfoData> topInfoList) {
		this.topInfoList = topInfoList;
	}

	public File getPic1_file() {
		return pic1_file;
	}

	public void setPic1_file(File pic1_file) {
		this.pic1_file = pic1_file;
	}

	public String getPic1_word() {
		return pic1_word;
	}

	public void setPic1_word(String pic1_word) {
		this.pic1_word = pic1_word;
	}

	public String getPic1_link() {
		return pic1_link;
	}

	public void setPic1_link(String pic1_link) {
		this.pic1_link = pic1_link;
	}

	public List<AdImages> getAdImagesList() {
		return adImagesList;
	}

	public void setAdImagesList(List<AdImages> adImagesList) {
		this.adImagesList = adImagesList;
	}

	public File getPic2_file() {
		return pic2_file;
	}

	public void setPic2_file(File pic2_file) {
		this.pic2_file = pic2_file;
	}

	public String getPic2_word() {
		return pic2_word;
	}

	public void setPic2_word(String pic2_word) {
		this.pic2_word = pic2_word;
	}

	public String getPic2_link() {
		return pic2_link;
	}

	public void setPic2_link(String pic2_link) {
		this.pic2_link = pic2_link;
	}

	public File getPic3_file() {
		return pic3_file;
	}

	public void setPic3_file(File pic3_file) {
		this.pic3_file = pic3_file;
	}

	public String getPic3_word() {
		return pic3_word;
	}

	public void setPic3_word(String pic3_word) {
		this.pic3_word = pic3_word;
	}

	public String getPic3_link() {
		return pic3_link;
	}

	public void setPic3_link(String pic3_link) {
		this.pic3_link = pic3_link;
	}

	public File getPic4_file() {
		return pic4_file;
	}

	public void setPic4_file(File pic4_file) {
		this.pic4_file = pic4_file;
	}

	public String getPic4_word() {
		return pic4_word;
	}

	public void setPic4_word(String pic4_word) {
		this.pic4_word = pic4_word;
	}

	public String getPic4_link() {
		return pic4_link;
	}

	public void setPic4_link(String pic4_link) {
		this.pic4_link = pic4_link;
	}

	public List<Scheme> getHotSchemeList() {
		return hotSchemeList;
	}

	public void setHotSchemeList(List<Scheme> hotSchemeList) {
		this.hotSchemeList = hotSchemeList;
	}

	public Boolean getZcExists() {
		return zcExists;
	}

	public void setZcExists(Boolean zcExists) {
		this.zcExists = zcExists;
	}
	
	public File getPic5_file() {
		return pic5_file;
	}

	public void setPic5_file(File pic5_file) {
		this.pic5_file = pic5_file;
	}

	public String getPic5_word() {
		return pic5_word;
	}

	public void setPic5_word(String pic5_word) {
		this.pic5_word = pic5_word;
	}

	public String getPic5_link() {
		return pic5_link;
	}

	public void setPic5_link(String pic5_link) {
		this.pic5_link = pic5_link;
	}

	public File getPic6_file() {
		return pic6_file;
	}

	public void setPic6_file(File pic6_file) {
		this.pic6_file = pic6_file;
	}

	public String getPic6_word() {
		return pic6_word;
	}

	public void setPic6_word(String pic6_word) {
		this.pic6_word = pic6_word;
	}

	public String getPic6_link() {
		return pic6_link;
	}

	public void setPic6_link(String pic6_link) {
		this.pic6_link = pic6_link;
	}

	public List<SaleAnalyse> getSsqSaleAnalyseList() {
		return ssqSaleAnalyseList;
	}

	public void setSsqSaleAnalyseList(List<SaleAnalyse> ssqSaleAnalyseList) {
		this.ssqSaleAnalyseList = ssqSaleAnalyseList;
	}
	public SsqPeriodData getSsqPeriodData() {
		return ssqPeriodData;
	}
	public void setSsqPeriodData(SsqPeriodData ssqPeriodData) {
		this.ssqPeriodData = ssqPeriodData;
	}
	public NumberSaleBean getSsqSaleBean() {
		return ssqSaleBean;
	}
	public void setSsqSaleBean(NumberSaleBean ssqSaleBean) {
		this.ssqSaleBean = ssqSaleBean;
	}
	public DltPeriodData getDltPeriodData() {
		return dltPeriodData;
	}
	public void setDltPeriodData(DltPeriodData dltPeriodData) {
		this.dltPeriodData = dltPeriodData;
	}
	public NumberSaleBean getDltSaleBean() {
		return dltSaleBean;
	}
	public void setDltSaleBean(NumberSaleBean dltSaleBean) {
		this.dltSaleBean = dltSaleBean;
	}
	public Welfare3dPeriodData getWelfare3dPeriodData() {
		return welfare3dPeriodData;
	}
	public void setWelfare3dPeriodData(Welfare3dPeriodData welfare3dPeriodData) {
		this.welfare3dPeriodData = welfare3dPeriodData;
	}
	public NumberSaleBean getWelfare3dSaleBean() {
		return welfare3dSaleBean;
	}
	public void setWelfare3dSaleBean(NumberSaleBean welfare3dSaleBean) {
		this.welfare3dSaleBean = welfare3dSaleBean;
	}
	public SfzcPeriodData getSfzcPeriodData() {
		return sfzcPeriodData;
	}
	public void setSfzcPeriodData(SfzcPeriodData sfzcPeriodData) {
		this.sfzcPeriodData = sfzcPeriodData;
	}
	public SczcPeriodData getSczcPeriodData() {
		return sczcPeriodData;
	}
	public void setSczcPeriodData(SczcPeriodData sczcPeriodData) {
		this.sczcPeriodData = sczcPeriodData;
	}
	public LczcPeriodData getLczcPeriodData() {
		return lczcPeriodData;
	}
	public void setLczcPeriodData(LczcPeriodData lczcPeriodData) {
		this.lczcPeriodData = lczcPeriodData;
	}
	public Period getSfzcPeriod() {
		return sfzcPeriod;
	}
	public void setSfzcPeriod(Period sfzcPeriod) {
		this.sfzcPeriod = sfzcPeriod;
	}
	public Period getSczcPeriod() {
		return sczcPeriod;
	}
	public void setSczcPeriod(Period sczcPeriod) {
		this.sczcPeriod = sczcPeriod;
	}
	public Period getLczcPeriod() {
		return lczcPeriod;
	}
	public void setLczcPeriod(Period lczcPeriod) {
		this.lczcPeriod = lczcPeriod;
	}
	public PlPeriodData getPlPeriodData() {
		return plPeriodData;
	}
	public void setPlPeriodData(PlPeriodData plPeriodData) {
		this.plPeriodData = plPeriodData;
	}
	public SevenPeriodData getSevenPeriodData() {
		return sevenPeriodData;
	}
	public void setSevenPeriodData(SevenPeriodData sevenPeriodData) {
		this.sevenPeriodData = sevenPeriodData;
	}
	public Period getSsqPeriod() {
		return ssqPeriod;
	}
	public void setSsqPeriod(Period ssqPeriod) {
		this.ssqPeriod = ssqPeriod;
	}
	public Period getDltPeriod() {
		return dltPeriod;
	}
	public void setDltPeriod(Period dltPeriod) {
		this.dltPeriod = dltPeriod;
	}
	public Period getWelfare3dPeriod() {
		return welfare3dPeriod;
	}
	public void setWelfare3dPeriod(Period welfare3dPeriod) {
		this.welfare3dPeriod = welfare3dPeriod;
	}
	public Period getPlPeriod() {
		return plPeriod;
	}
	public void setPlPeriod(Period plPeriod) {
		this.plPeriod = plPeriod;
	}
	public Period getSevenPeriod() {
		return sevenPeriod;
	}
	public void setSevenPeriod(Period sevenPeriod) {
		this.sevenPeriod = sevenPeriod;
	}
	public List<SaleAnalyse> getDltSaleAnalyseList() {
		return dltSaleAnalyseList;
	}
	public void setDltSaleAnalyseList(List<SaleAnalyse> dltSaleAnalyseList) {
		this.dltSaleAnalyseList = dltSaleAnalyseList;
	}
	public List<SaleAnalyse> getSfzcSaleAnalyseList() {
		return sfzcSaleAnalyseList;
	}
	public void setSfzcSaleAnalyseList(List<SaleAnalyse> sfzcSaleAnalyseList) {
		this.sfzcSaleAnalyseList = sfzcSaleAnalyseList;
	}
	public List<SaleAnalyse> getDczcSaleAnalyseList() {
		return dczcSaleAnalyseList;
	}
	public void setDczcSaleAnalyseList(List<SaleAnalyse> dczcSaleAnalyseList) {
		this.dczcSaleAnalyseList = dczcSaleAnalyseList;
	}
	public List<NewsInfoData> getRedianList() {
		return redianList;
	}
	public void setRedianList(List<NewsInfoData> redianList) {
		this.redianList = redianList;
	}
	public List<NewsInfoData> getGonggaoList() {
		return gonggaoList;
	}
	public void setGonggaoList(List<NewsInfoData> gonggaoList) {
		this.gonggaoList = gonggaoList;
	}
	public List<NewsInfoData> getHelpList() {
		return helpList;
	}
	public void setHelpList(List<NewsInfoData> helpList) {
		this.helpList = helpList;
	}
 
	public List<NewsInfoData> getJczqList() {
		return jczqList;
	}
	public void setJczqList(List<NewsInfoData> jczqList) {
		this.jczqList = jczqList;
	}
	public List<NewsInfoData> getJclqList() {
		return jclqList;
	}
	public void setJclqList(List<NewsInfoData> jclqList) {
		this.jclqList = jclqList;
	}
	public List<NewsInfoData> getJczqNewsList() {
		return jczqNewsList;
	}
	public void setJczqNewsList(List<NewsInfoData> jczqNewsList) {
		this.jczqNewsList = jczqNewsList;
	}
	public NewsInfoData getFirstJczqNews() {
		return firstJczqNews;
	}
	public void setFirstJczqNews(NewsInfoData firstJczqNews) {
		this.firstJczqNews = firstJczqNews;
	}
	public NewsInfoData getFirstSsqNews() {
		return firstSsqNews;
	}
	public void setFirstSsqNews(NewsInfoData firstSsqNews) {
		this.firstSsqNews = firstSsqNews;
	}
	public List<NewsInfoData> getSsqNewsList() {
		return ssqNewsList;
	}
	public void setSsqNewsList(List<NewsInfoData> ssqNewsList) {
		this.ssqNewsList = ssqNewsList;
	}
	public NewsInfoData getFirstSevenNews() {
		return firstSevenNews;
	}
	public void setFirstSevenNews(NewsInfoData firstSevenNews) {
		this.firstSevenNews = firstSevenNews;
	}
	public List<NewsInfoData> getSevenNewsList() {
		return sevenNewsList;
	}
	public void setSevenNewsList(List<NewsInfoData> sevenNewsList) {
		this.sevenNewsList = sevenNewsList;
	}
	public NewsInfoData getFirstDczcNews() {
		return firstDczcNews;
	}
	public void setFirstDczcNews(NewsInfoData firstDczcNews) {
		this.firstDczcNews = firstDczcNews;
	}
	public List<NewsInfoData> getDczcNewsList() {
		return dczcNewsList;
	}
	public void setDczcNewsList(List<NewsInfoData> dczcNewsList) {
		this.dczcNewsList = dczcNewsList;
	}
	public NewsInfoData getFirstSfzcNews() {
		return firstSfzcNews;
	}
	public void setFirstSfzcNews(NewsInfoData firstSfzcNews) {
		this.firstSfzcNews = firstSfzcNews;
	}
	public List<NewsInfoData> getSfzcNewsList() {
		return sfzcNewsList;
	}
	public void setSfzcNewsList(List<NewsInfoData> sfzcNewsList) {
		this.sfzcNewsList = sfzcNewsList;
	}
	public NewsInfoData getFirstDltNews() {
		return firstDltNews;
	}
	public void setFirstDltNews(NewsInfoData firstDltNews) {
		this.firstDltNews = firstDltNews;
	}
	public List<NewsInfoData> getDltNewsList() {
		return dltNewsList;
	}
	public void setDltNewsList(List<NewsInfoData> dltNewsList) {
		this.dltNewsList = dltNewsList;
	}
	public List<SaleAnalyse> getAllSaleAnalyseList() {
		return allSaleAnalyseList;
	}
	public void setAllSaleAnalyseList(List<SaleAnalyse> allSaleAnalyseList) {
		this.allSaleAnalyseList = allSaleAnalyseList;
	}
	public Map<String, List<Scheme>> getTop10Scheme() {
		return top10Scheme;
	}
	public void setTop10Scheme(Map<String, List<Scheme>> top10Scheme) {
		this.top10Scheme = top10Scheme;
	}
	public List getZjphList() {
		return zjphList;
	}
	public void setZjphList(List zjphList) {
		this.zjphList = zjphList;
	}
	public List<Subscription> getZhongjiangList() {
		return zhongjiangList;
	}
	public void setZhongjiangList(List<Subscription> zhongjiangList) {
		this.zhongjiangList = zhongjiangList;
	}

}
